import {get, post} from '@/request/useRequest'
import {GridParams, ResponseBody} from '@/api/typing';
import {Department} from "@/api/system/core/typing";

export async function selectAll(): Promise<ResponseBody<Department[]>> {
  return get('department/selectAll');
}

export async function selectAllAndFactory(): Promise<ResponseBody<Department[]>> {
  return get('department/selectAllAndFactory');
}

export async function list(params: GridParams): Promise<ResponseBody> {
  return get('department/list', params);
}

export async function exists(params: object): Promise<ResponseBody> {
  return get('department/exists', params);
}

export async function upsert(params: object): Promise<ResponseBody> {
  return post('department/upsert', params);
}

export async function deletes(params: []): Promise<ResponseBody> {
  return post('department/deletes', params);
}